<template>
  <view> </view>
</template>

<script>
import { mapState, mapGetters } from "vuex";

export default {
  data() {
    return {};
  },
  computed: {
    ...mapState(["hasLogin", "userInfo"]),
    ...mapGetters(["getIsCustomer", "getIsPE"]),
  },

  onLoad: function () {
    if (this.hasLogin) {
      // uni.switchTab({
      //     url: '/pages/home/home'
      // });
      if (getIsCustomer() === true) {
        uni.redirectTo({
          url: "../apply/apply",
        });
      } else {
        uni.redirectTo({
          url: "../approve/approve",
        });
      }
    } else {
      uni.redirectTo({
        url: "../logIn/logIn",
      });
    }
  },
  methods: {},
};
</script>
<style>
page {
  background-color: #fff;
}
</style>
